<template>
    <div id='' class='edit_menu'>
        <Card :bordered="false" dis-hover class="ivu-mb">
            <div slot="title" style="height:34px;line-height:34px;">
                <Avatar icon="md-apps" size="small" v-color="'#1890ff'" v-bg-color="'#e6f7ff'" />
                <span class="ivu-pl-8">编辑菜单</span>
                <span v-if="option">：{{ option.title }}</span>
            </div>
            <div class="form_info">
                <AddOrUpdate ref="addOrEdit" />
                <div class="button">
                    <Button type="primary" @click="handleSubmitUpdate" :loading="submitting">保存修改</Button>
                </div>
            </div>
        </Card>
    </div>
</template>
<script>
import AddOrUpdate from './addOrUpdate.vue'
export default {
    name: '',
    inject:['provideClick'],
    props: ['option'],
    data() {
        return {
            submitting: false,
        };
    },
    components: { AddOrUpdate },
    computed: {},
    beforeMount() { },
    mounted() { },
    methods: {
        setInit(row) {
            this.$nextTick(() => {
                this.$refs.addOrEdit.setInit(row)
            })
        },
        // 表单提交更新方法
        handleSubmitUpdate() {
            this.$refs.addOrEdit.getFormData(()=>{
                this.provideClick('编辑成功',{})
            })
        },
    },
    watch: {}
}
</script>
<style lang='less' scoped>
.edit_menu .form_info {
    height: 720px;
    overflow-y: auto;
}
.edit_menu .button {
    width: 100%;
    text-align: right;
}
</style>